package com.coda.controller.user;

import com.coda.common.Result;
import com.coda.pojo.Saying;
import com.coda.service.SayingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 励志语录controller
 */
@RestController
@RequestMapping("/user/saying")
public class SayingController {

    @Autowired
    private SayingService sayingService;

    /**
     * 获取所有励志语录
     */
    @GetMapping
    public Result<List<Saying>> getSaying() {
        List<Saying> result = sayingService.getSaying();
        return Result.success(result);
    }
}
